﻿using UnityEngine;

[System.Serializable]
public class MaterialColorSchemeData : ColorSchemeData
{
    public GradientType MGradientType;
    private Gradient gradient;
}

[ColorNameAttritule(typeof(MaterialColorSchemeData))]
public class MaterialColorProcess : ColorProcess
{
    protected static MaterialPropertyBlock _propertyBlock = new MaterialPropertyBlock();
    public override void Progress(ColorSchemeData data,int colorIndex)
    {
        base.Progress(data,colorIndex);
        MaterialColorSchemeData materialColorSchemeData = (MaterialColorSchemeData)data;
        materialColorSchemeData.CRenderer.GetPropertyBlock(_propertyBlock);
        // materialColorSchemeData.CRenderer.SetPropertyBlock();
        _propertyBlock.SetColor(materialColorSchemeData.propertyName, ColorModule.Instance.GradientA.colorKeys[colorIndex].color);
        materialColorSchemeData.CRenderer.SetPropertyBlock(_propertyBlock,materialColorSchemeData.matIndex);
    }
}

public class ColorProcess
{
    public virtual void Progress(ColorSchemeData data,int colorIndex)
    {
            
    }
}